home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / wildcat / asend100.zip / AUTOSEND.WCC < prev    next >
Text File  |  1996-08-21  |  3KB  |  147 lines

  1.  
  2. rem ****  Listserv Autosend Utility v1.00 (08/21/96) 
  3. rem ****  Author: Pete Nelson (pete@terminal-one.com, weasel@ecis.com
  4. rem ****  http://www.ecis.com/~weasel/wccode/wccode.html
  5.  
  6.  
  7. rem ****  This source code is designed for use on a Wildcat v4
  8. rem ****  system.  Feel free to modify the source code for
  9. rem ****  Wildcat v5.  The data record for the WC5 version of
  10. rem ****  Listserv is included.
  11.  
  12. rem ****  This is the subscriber list data record for the
  13. rem ****  Wildcat v4 version of Listserv
  14.  
  15. type sublist_rec
  16.      name as string*70
  17.      date_subscribed as date
  18.      real_name as string*30
  19. end type
  20.  
  21.  
  22.  
  23. rem ****  This is the subscriber list data record for the
  24. rem ****  Wildcat v5 version of Listserv
  25. rem ****
  26. rem ****  type sublist_rec
  27. rem ****       name as string*70
  28. rem ****       date_subscribed as datetime
  29. rem ****       real_name as string*30
  30. rem ****  end type
  31.  
  32.  
  33. cls
  34. print "@0F@Listserv Autosend Utility v1.00 (08/21/96) - by Pete Nelson"
  35. print "Terminal One BBS (510) 689-9528"
  36. print "Author: pete@terminal-one.com"
  37. print
  38.  
  39. delay 1
  40.  
  41. dim sublist as sublist_rec
  42. dim email_conf as integer, msg_from as string
  43. dim subfile as string, textfile as string
  44. dim recnum as long, msg as messageheader, urec as userrecord
  45. dim config_file as string, temptext1 as string
  46. dim msg_subject as string
  47.  
  48. const blank = "<BLANK>"
  49.  
  50.  
  51. moreprompt off
  52.  
  53. if paramstr(1) = "" then
  54.    config_file = "autosend.cfg"
  55. else
  56.    config_file = paramstr(1)
  57. end if
  58.  
  59.  
  60. rem   *** Subscriber File
  61. rem   *** Text File
  62. rem   *** From Name
  63. rem   *** Subject
  64. rem   *** Conference
  65.  
  66.  
  67.  
  68. open config_file for input as #1
  69. input #1, subfile
  70. input #1, textfile
  71. input #1, msg_from
  72. input #1, msg_subject
  73. input #1, temptext1
  74. close #1
  75.  
  76. subfile = trim(subfile)
  77. textfile = trim(textfile)
  78. msg_from = ucase(trim(msg_from))
  79. msg_subject = trim(msg_subject)
  80. email_conf = val(trim(temptext1))
  81.  
  82.  
  83.  
  84. if not exists(subfile) then
  85.    print
  86.    print "@0C@" subfile " @0F@does not exist."
  87.    print
  88.    waitenter
  89.    end
  90. end if
  91.  
  92. if not exists(textfile) then
  93.    print
  94.    print "@0C@" textfile " @0F@does not exist."
  95.    print
  96.    waitenter
  97.    end
  98. end if
  99.  
  100.  
  101.  
  102. open subfile for random as #1 len = len(sublist_rec)
  103.  
  104.  
  105. recnum = 1
  106.  
  107. print
  108.  
  109. do
  110.  
  111.    get #1, recnum, sublist
  112.  
  113.    if sublist.name <> blank then
  114.  
  115.       msg.to = sublist.name
  116.       msg.from = msg_from
  117.       msg.fromid = 0
  118.       msg.toid = 0
  119.       if getuser(urec,msg.to) then msg.toid = urec.userid
  120.       if getuser(urec,msg.from) then msg.fromid = urec.userid
  121.       msg.subject = msg_subject
  122.       msg.network = ""
  123.       msg.flags = 3
  124.        
  125.       addmessage(msg, textfile, "", email_conf)
  126.  
  127.       print "@0A@Sending @0F@" msg.subject " @0A@to @0E@" msg.to
  128.       updatescreen
  129.             
  130.  
  131.  
  132.    end if
  133.  
  134.    inc recnum
  135.  
  136. loop until recnum > lof(1)
  137.  
  138.  
  139. print
  140. print "@0B@Done!"
  141. delay 2
  142. end
  143.  
  144.  
  145.  
  146.  
  147.